﻿using System;

using System.Collections.Generic;
using System.Text;
using Silvermoon.Animations;

namespace Silvermoon.UI
{
    /// <summary>
    /// Container for  used in conjunction with <see cref="PropertyAccessor"/> that stores data when a property is being animated.
    /// </summary>
    public abstract class PropertyTracking
    {
        public abstract void Clear();
    }

    internal class PropertyTracking<T> : PropertyTracking
    {
        public Animation<T> CurrentAnimation;
        public T OriginalValue;

        public override void Clear()
        {
            var ca = CurrentAnimation;
            if (ca != null)
            {
                ca.Abort();
                ca.ClearDelegates();
                ca = null;
            }
        }

    }
}
